#include<bits/stdc++.h>
using namespace std;
const int N=1e5+7;
int n,a[N],ans,lft,top=0,s[N];
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    ans=n;
    for(int i=1;i<=n;i++)
      cin>>a[i];
    sort(a+1,a+n+1);
    for(int i=1;i<=n;i++){
        if(a[i]!=a[i-1]) top++;
        s[top]++;
    }
    lft=s[1];
    for(int i=2;i<=top;i++){
        if(s[i]>=lft) lft=s[i],ans-=lft;
          else ans-=s[i];
    }
    cout<<ans;
    return 0;
}
